package com.hqyj.javaSpringBoot.modules.test.service;

import com.hqyj.javaSpringBoot.modules.common.entity.Result;
import com.hqyj.javaSpringBoot.modules.common.entity.SearchBean;
import com.hqyj.javaSpringBoot.modules.test.entity.Student;
import org.springframework.data.domain.Page;

import java.util.List;

public interface StudentService {

//    Result<Student> insertStudent(Student student);

    /**
     * 插入和更新学生
     * @param student
     * @return
     */
    Result<Student> editStudent(Student student);

    /**
     * 删除学生
     * @param id
     * @return
     */
    Result<Object> deleteStudent(int id);

    /**
     * 通过学生id查询学生
     * @param id
     * @return
     */
    Student getStudentById(int id);

    /**
     * 查询所有学生
     * @return
     */
    List<Student> getStudents();

    /**
     * 通过姓名和邮箱查询学生
     * 需要写DAO层 ---- Student findFirstByNameAndEmail();
     * @param name
     * @param email
     * @return
     */
    Student getStudentByNameAndEmail(String name,String email);

    /**
     * 对Student进行分页查询
     * @param searchBean
     * @return
     */
    Page<Student> getStudentsBySearchBean(SearchBean searchBean);

    /**
     * 批量操作接口
     * @param students
     * @return
     */
    Result<Object> insertStudents(List<Student> students);
}
